package com.llh.controller.processdata.computVo;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 数据主键字段
 */
public class PrimaryKey implements Serializable {
    private static final long serialVersionUID = 1L;
    //股票代码(主键字段)
    private String ts_code;
    //解禁日(主键字段)
    private Date open_day;
    //股票名称
    private String name;

    @Override
    public String toString() {
        return "PrimaryKey{" +
                "ts_code='" + ts_code + '\'' +
                ", open_day=" + open_day +
                ", name='" + name + '\'' +
                '}';
    }

    public String getTs_code() {
        return ts_code;
    }

    public void setTs_code(String ts_code) {
        this.ts_code = ts_code;
    }

    public Date getOpen_day() {
        return open_day;
    }

    public void setOpen_day(Date open_day) {
        this.open_day = open_day;
    }

    public PrimaryKey(String ts_code, Date open_day, String name) {
        this.ts_code = ts_code;
        this.open_day = open_day;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public PrimaryKey(String ts_code, Date open_day) {
        this.ts_code = ts_code;
        this.open_day = open_day;
    }

    public PrimaryKey() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PrimaryKey that = (PrimaryKey) o;
        return Objects.equals(ts_code, that.ts_code) &&
                Objects.equals(open_day, that.open_day);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ts_code, open_day);
    }
}
